package com.joven.shelltest.utils.commandmodel;

import java.util.ArrayList;
import java.util.List;

/**
 * 命令调用者
 * @Author wzj
 * @Date 2023-11-07 09:36
 **/
public class ServerInvoker {
    List<Command> commands = new ArrayList<>();

    public void addCommand(Command command){
        commands.add(command);
    }

    //调用命令执行
    public void invoke(){
        for (Command command : commands){
            command.execute();
        }
    }
}
